import axios from '@/libs/api.request'
// 创建问题
export const createQuestion = (data) => {
  return axios.request({
    url: '/api/as/csc/questionconsultation/createQuestion',
    data: data,
    method: 'post'

  })
}
// 查看详情
export const byIdInfo = (data) => {
  return axios.request({
    url: '/api/as/csc/questionconsultation/byIdInfo',
    data: data,
    method: 'post'

  })
}
// 更改信息
export const updateInfoById = (data) => {
  return axios.request({
    url: '/api/as/csc/questionconsultation/updateInfoById',
    data: data,
    method: 'post'

  })
}

export const findItemList = () => {
  return axios.request({
    url: '/api/as/csc/questionconsultation/findItemList',
    method: 'post'

  })
}
// 问题咨询列表
export const findGuestionConsultationList = (data) => {
  return axios.request({
    url: '/api/as/csc/questionconsultation/findGuestionConsultationList',
    data: data,
    method: 'post'

  })
}
// 时间转换为日期-> 2019-02-02
export function date2str (date, containtime) {
  if (!date || typeof date === 'string') {
    return date
  }
  var time1 = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()
  time1 += '-' + (month < 10 ? '0' + month : month)
  time1 += '-' + (day < 10 ? '0' + day : day)
  return time1
}
